Skip to content

Fix result summary reporter initialization - #81

Merged
matejicko merged 1 commit into
Kros-sk:masterfrom
pavolbetak:master
Jan 28, 2026
Merged

Fix result summary reporter initialization#81
matejicko merged 1 commit into
Kros-sk:masterfrom
pavolbetak:master

Conversation

@pavolbetak

@pavolbetak pavolbetak commented Jan 27, 2026

Copy link
Copy Markdown
Collaborator

Problem: Test scenarios that contained scheduled tests and did not contain a test file had problems with initializing the summary results reporter.
Fix: Add initialization of result summary reporter into execution of scheduling tests

Summary by CodeRabbit

  • Bug Fixes

    • Prevented duplicate initialization of test results reporter to avoid potential errors.
  • Documentation

    • Clarified restrictions for test scripts regarding HTTP response handling outside designated methods.
    • Updated testing guidelines for improved script execution clarity.
  • Chores

    • Version updated to 1.5.2.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 27, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR introduces a test results summary reporter initialization mechanism in the scheduled test execution pipeline, bumps versions to 1.5.2, updates related documentation clarifying .csx script restrictions, and includes corresponding test updates with new test coverage for reporter initialization sequencing.

Changes

Cohort / File(s) Summary
Documentation updates
docs/docs/how-to-write-tests.md, docs/docs/test-case/post-response-script.md
Added warnings clarifying that .csx scripts must not access or process HTTP responses outside of tp.Test methods; updated definitions and restrictions sections.
Version bumps
src/Directory.Build.props, src/TeaPie/TeaPie.csproj
Incremented library version from 1.5.1/1.3.0 to 1.5.2 across build and project configuration files.
Reporter initialization logic
src/TeaPie/Reporting/TestResultsSummaryReporter.cs, src/TeaPie/Testing/ExecuteScheduledTestsStep.cs
Added early return guard in reporter's Initialize method to prevent reinitialization; injected ITestResultsSummaryReporter dependency into ExecuteScheduledTestsStep and called Initialize before executing tests.
Logging adjustment
src/TeaPie/Testing/Tester.cs
Changed log level for LogTestAlreadyExecuted from Information to Debug.
Test suite updates
tests/TeaPie.Tests/ApplicationPipelineShould.cs, tests/TeaPie.Tests/Reporting/TestsResultsSummaryReporterShould.cs, tests/TeaPie.Tests/Testing/ExecuteScheduledTestsStepShould.cs
Updated constructor calls to match new ExecuteScheduledTestsStep signature; converted reporter tests to async; added new test for double-initialization prevention; introduced comprehensive test suite for reporter initialization and test execution sequencing.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ExecuteScheduledTestsStep as ExecuteScheduledTestsStep
    participant TestResultsSummaryReporter
    participant ITestScheduler
    participant ITester

    Client->>ExecuteScheduledTestsStep: Execute()
    ExecuteScheduledTestsStep->>TestResultsSummaryReporter: Initialize()
    rect rgba(200, 150, 255, 0.5)
        note over TestResultsSummaryReporter: Check _started flag<br/>If already started, return early
        TestResultsSummaryReporter->>TestResultsSummaryReporter: Create & Start Summary<br/>Set _started = true
    end
    loop For each scheduled test
        ExecuteScheduledTestsStep->>ITestScheduler: DequeueScheduledTest()
        ITestScheduler-->>ExecuteScheduledTestsStep: Test
        ExecuteScheduledTestsStep->>ITester: ExecuteOrSkipTest(test, testCase)
        ITester->>ITester: Execute test
    end
    ExecuteScheduledTestsStep-->>Client: Tests executed
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • matejicko

Poem

🐰 A reporter awakens with careful grace,
No double-starting in this race,
Tests queue up, then one by one,
Initialization guards ensure it's done,
Scheduled tests dance to completion's tune! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly summarizes the main change: adding initialization of the result summary reporter, which is the primary focus across multiple modified files.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@matejicko
matejicko merged commit 175484b into Kros-sk:master Jan 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants